package com.yanqu.road.server.cmd.activity.flowerstudy;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.FlowerStudyProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.flowerstudy.FlowerStudyModule;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_FLOWER_STUDY_EXAM_MATCHING_START, desc = "开始匹配")
public class FlowerStudyStartMatchingCmd extends AbstractCommand {

    private int activityId;

    private int type;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        FlowerStudyProto.FlowerStudyExamMatchingStartReq req = FlowerStudyProto.FlowerStudyExamMatchingStartReq.parseFrom(packet.getBytes());

        activityId = req.getActivityId();
        type = req.getRoomType();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        ret = player.getModule(FlowerStudyModule.class).startMatching(activityId,type);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
